package csc.ex.bs.test;
// Generated Apr 3, 2014 10:01:27 AM by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Book generated by hbm2java
 */
@Entity
@Table(name = "book", catalog = "bookstore")
public class Book implements java.io.Serializable {

	private Integer id;
	private Category category;
	private String nameEn;
	private String nameVi;
	private String externalUrl;
	private String coverThumb;
	private String coverFull;
	private String descriptionEn;
	private String descriptionVi;
	private Date publishedDate;
	private String publisher;
	private String author;
	private int total;
	private double price;
	private Set orderDetails = new HashSet(0);

	public Book() {
	}

	public Book(Category category, String nameEn, String nameVi, int total,
			double price) {
		this.category = category;
		this.nameEn = nameEn;
		this.nameVi = nameVi;
		this.total = total;
		this.price = price;
	}

	public Book(Category category, String nameEn, String nameVi,
			String externalUrl, String coverThumb, String coverFull,
			String descriptionEn, String descriptionVi, Date publishedDate,
			String publisher, String author, int total, double price,
			Set orderDetails) {
		this.category = category;
		this.nameEn = nameEn;
		this.nameVi = nameVi;
		this.externalUrl = externalUrl;
		this.coverThumb = coverThumb;
		this.coverFull = coverFull;
		this.descriptionEn = descriptionEn;
		this.descriptionVi = descriptionVi;
		this.publishedDate = publishedDate;
		this.publisher = publisher;
		this.author = author;
		this.total = total;
		this.price = price;
		this.orderDetails = orderDetails;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "category_id", nullable = false)
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Column(name = "name_en", nullable = false, length = 100)
	public String getNameEn() {
		return this.nameEn;
	}

	public void setNameEn(String nameEn) {
		this.nameEn = nameEn;
	}

	@Column(name = "name_vi", nullable = false, length = 100)
	public String getNameVi() {
		return this.nameVi;
	}

	public void setNameVi(String nameVi) {
		this.nameVi = nameVi;
	}

	@Column(name = "external_url")
	public String getExternalUrl() {
		return this.externalUrl;
	}

	public void setExternalUrl(String externalUrl) {
		this.externalUrl = externalUrl;
	}

	@Column(name = "cover_thumb", length = 45)
	public String getCoverThumb() {
		return this.coverThumb;
	}

	public void setCoverThumb(String coverThumb) {
		this.coverThumb = coverThumb;
	}

	@Column(name = "cover_full", length = 45)
	public String getCoverFull() {
		return this.coverFull;
	}

	public void setCoverFull(String coverFull) {
		this.coverFull = coverFull;
	}

	@Column(name = "description_en", length = 65535)
	public String getDescriptionEn() {
		return this.descriptionEn;
	}

	public void setDescriptionEn(String descriptionEn) {
		this.descriptionEn = descriptionEn;
	}

	@Column(name = "description_vi", length = 65535)
	public String getDescriptionVi() {
		return this.descriptionVi;
	}

	public void setDescriptionVi(String descriptionVi) {
		this.descriptionVi = descriptionVi;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publishedDate", length = 19)
	public Date getPublishedDate() {
		return this.publishedDate;
	}

	public void setPublishedDate(Date publishedDate) {
		this.publishedDate = publishedDate;
	}

	@Column(name = "publisher")
	public String getPublisher() {
		return this.publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	@Column(name = "author")
	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(name = "total", nullable = false)
	public int getTotal() {
		return this.total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	@Column(name = "price", nullable = false, precision = 22, scale = 0)
	public double getPrice() {
		return this.price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "book")
	public Set getOrderDetails() {
		return this.orderDetails;
	}

	public void setOrderDetails(Set orderDetails) {
		this.orderDetails = orderDetails;
	}

}
